﻿///***************************************************************
/// 시  스  템 : Updms.Etc.Dac
/// 단위시스템 : ETC
/// 계      층 : Data Access Layer
/// 프로그램명 : Etc_Dac_UPDMS_ETC_WEBSITE
/// 파  일  명 : Etc_Dac_UPDMS_ETC_WEBSITE.cs
/// 설      명 : 웹사이트관리
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-08-05 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Etc.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Etc_Dac_UPDMS_ETC_WEBSITE : Base.AppFramework.DacBase
	{
		public Etc_Dac_UPDMS_ETC_WEBSITE()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Get_Search_Count";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_ETC_WEBSITE", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetWebSitePassword]
		/// <summary>
		/// 웹사이트 비밀번호 조회
		/// </summary>
		/// <param name="ls_seq">Seq</param>
		/// <returns>DataSet</returns>
		[AutoComplete]
		public DataSet GetWebSitePassword(string ls_seq)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Get_WebSite_Password";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_seq", ls_seq)
			};

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_ETC_WEBSITE", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion			
		

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Update";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [SetFavorite]
		/// <summary>
		/// 즐겨찾기를 설정/해제 한다
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int SetFavorite(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_ETC_WEBSITE_Set_Favorite";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion
	}
}
